﻿using System.Windows.Controls;
using System.Windows.Input;
using LiSAClient.WpfClient.ViewModel.Frame.Menus;

namespace LiSAClient.WpfClient.View.Frame.Menus
{
    /// <summary>
    /// Interaction logic for DetachedWindowMenuItem.xaml
    /// </summary>
    public partial class DetachedWindowMenuItem : UserControl
    {
        private DetachedWindowMenuItemViewModel ViewModel
        {
            get
            {
                return this.DataContext as DetachedWindowMenuItemViewModel;
            }
        }
        public DetachedWindowMenuItem()
        {
            InitializeComponent();
        }

        private void LeftMouseUp(object sender, MouseButtonEventArgs e)
        {
            this.Focus();
            if (this.ViewModel != null && this.ViewModel.ActionCommand != null)
            {
                this.ViewModel.ActionCommand.Execute(null);
            }

        }
    }
}
